add enable_empty and value_in_list properties.
authorMichael Meeks <michael@ximian.com>
Thu, 11 Oct 2001 06:14:46 +0000 (06:14 +0000)
committerMichael Meeks <michael@src.gnome.org>
Thu, 11 Oct 2001 06:14:46 +0000 (06:14 +0000)
2001-10-10  Michael Meeks  <michael@ximian.com>

* gtk/gtkcombo.c (gtk_combo_class_init): add enable_empty
and value_in_list properties.
(gtk_combo_set_value_in_list): notify change.
(gtk_combo_set_property, gtk_combo_get_property): impl. prop.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcombo.c

index 1cc7cce3c39290b37101bdebba1ef2aca32d9f0d..632dcd8b2ca15d1f5296645d22c53fc5dbad6245 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-10-10  Michael Meeks  <michael@ximian.com>
+
+       * gtk/gtkcombo.c (gtk_combo_class_init): add enable_empty
+       and value_in_list properties.
+       (gtk_combo_set_value_in_list): notify change.
+       (gtk_combo_set_property, gtk_combo_get_property): impl. prop.
+
 2001-10-11  James Henstridge  <james@daa.com.au>
 
        * configure.in: add AS=CC and ASFLAGS=CFLAGS substitutions so
index 1cc7cce3c39290b37101bdebba1ef2aca32d9f0d..632dcd8b2ca15d1f5296645d22c53fc5dbad6245 100644 (file)
@@ -1,3 +1,10 @@
+2001-10-10  Michael Meeks  <michael@ximian.com>
+
+       * gtk/gtkcombo.c (gtk_combo_class_init): add enable_empty
+       and value_in_list properties.
+       (gtk_combo_set_value_in_list): notify change.
+       (gtk_combo_set_property, gtk_combo_get_property): impl. prop.
+
 2001-10-11  James Henstridge  <james@daa.com.au>
 
        * configure.in: add AS=CC and ASFLAGS=CFLAGS substitutions so
index 1cc7cce3c39290b37101bdebba1ef2aca32d9f0d..632dcd8b2ca15d1f5296645d22c53fc5dbad6245 100644 (file)
@@ -1,3 +1,10 @@
+2001-10-10  Michael Meeks  <michael@ximian.com>
+
+       * gtk/gtkcombo.c (gtk_combo_class_init): add enable_empty
+       and value_in_list properties.
+       (gtk_combo_set_value_in_list): notify change.
+       (gtk_combo_set_property, gtk_combo_get_property): impl. prop.
+
 2001-10-11  James Henstridge  <james@daa.com.au>
 
        * configure.in: add AS=CC and ASFLAGS=CFLAGS substitutions so
index 1cc7cce3c39290b37101bdebba1ef2aca32d9f0d..632dcd8b2ca15d1f5296645d22c53fc5dbad6245 100644 (file)
@@ -1,3 +1,10 @@
+2001-10-10  Michael Meeks  <michael@ximian.com>
+
+       * gtk/gtkcombo.c (gtk_combo_class_init): add enable_empty
+       and value_in_list properties.
+       (gtk_combo_set_value_in_list): notify change.
+       (gtk_combo_set_property, gtk_combo_get_property): impl. prop.
+
 2001-10-11  James Henstridge  <james@daa.com.au>
 
        * configure.in: add AS=CC and ASFLAGS=CFLAGS substitutions so
index 1cc7cce3c39290b37101bdebba1ef2aca32d9f0d..632dcd8b2ca15d1f5296645d22c53fc5dbad6245 100644 (file)
@@ -1,3 +1,10 @@
+2001-10-10  Michael Meeks  <michael@ximian.com>
+
+       * gtk/gtkcombo.c (gtk_combo_class_init): add enable_empty
+       and value_in_list properties.
+       (gtk_combo_set_value_in_list): notify change.
+       (gtk_combo_set_property, gtk_combo_get_property): impl. prop.
+
 2001-10-11  James Henstridge  <james@daa.com.au>
 
        * configure.in: add AS=CC and ASFLAGS=CFLAGS substitutions so
index 1cc7cce3c39290b37101bdebba1ef2aca32d9f0d..632dcd8b2ca15d1f5296645d22c53fc5dbad6245 100644 (file)
@@ -1,3 +1,10 @@
+2001-10-10  Michael Meeks  <michael@ximian.com>
+
+       * gtk/gtkcombo.c (gtk_combo_class_init): add enable_empty
+       and value_in_list properties.
+       (gtk_combo_set_value_in_list): notify change.
+       (gtk_combo_set_property, gtk_combo_get_property): impl. prop.
+
 2001-10-11  James Henstridge  <james@daa.com.au>
 
        * configure.in: add AS=CC and ASFLAGS=CFLAGS substitutions so
index 1cc7cce3c39290b37101bdebba1ef2aca32d9f0d..632dcd8b2ca15d1f5296645d22c53fc5dbad6245 100644 (file)
@@ -1,3 +1,10 @@
+2001-10-10  Michael Meeks  <michael@ximian.com>
+
+       * gtk/gtkcombo.c (gtk_combo_class_init): add enable_empty
+       and value_in_list properties.
+       (gtk_combo_set_value_in_list): notify change.
+       (gtk_combo_set_property, gtk_combo_get_property): impl. prop.
+
 2001-10-11  James Henstridge  <james@daa.com.au>
 
        * configure.in: add AS=CC and ASFLAGS=CFLAGS substitutions so
index 01ecbc5ba1b4409094837524426a49eed8f8b074..8a52efc436e4f25d86bd2465e2724a2549a2ed6c 100644 (file)
@@ -51,7 +51,9 @@ enum {
   PROP_0,
   PROP_ENABLE_ARROW_KEYS,
   PROP_ENABLE_ARROWS_ALWAYS,
-  PROP_CASE_SENSITIVE
+  PROP_CASE_SENSITIVE,
+  PROP_ALLOW_EMPTY,
+  PROP_VALUE_IN_LIST
 };
 
 static void         gtk_combo_class_init         (GtkComboClass    *klass);
@@ -148,6 +150,22 @@ gtk_combo_class_init (GtkComboClass * klass)
                                                          _("Whether list item matching is case sensitive"),
                                                          FALSE,
                                                          G_PARAM_READABLE | G_PARAM_WRITABLE));
+
+  g_object_class_install_property (gobject_class,
+                                   PROP_ALLOW_EMPTY,
+                                   g_param_spec_boolean ("allow_empty",
+                                                         _("Allow empty"),
+                                                        _("Whether an empty value may be entered in this field"),
+                                                         TRUE,
+                                                         G_PARAM_READABLE | G_PARAM_WRITABLE));
+
+  g_object_class_install_property (gobject_class,
+                                   PROP_VALUE_IN_LIST,
+                                   g_param_spec_boolean ("value_in_list",
+                                                         _("Value in list"),
+                                                         _("Whether entered values must already be present in the list"),
+                                                         FALSE,
+                                                         G_PARAM_READABLE | G_PARAM_WRITABLE));
   
    
   oclass->destroy = gtk_combo_destroy;
@@ -876,6 +894,10 @@ gtk_combo_set_value_in_list (GtkCombo * combo, gboolean val, gboolean ok_if_empt
 
   combo->value_in_list = val;
   combo->ok_if_empty = ok_if_empty;
+  g_object_freeze_notify (G_OBJECT (combo));
+  g_object_notify (G_OBJECT (combo), "value_in_list");
+  g_object_notify (G_OBJECT (combo), "allow_empty");
+  g_object_thaw_notify (G_OBJECT (combo));
 }
 
 void
@@ -1021,17 +1043,20 @@ gtk_combo_set_property (GObject         *object,
   switch (prop_id)
     {
     case PROP_ENABLE_ARROW_KEYS:
-      /* This call does the notification */
       gtk_combo_set_use_arrows (combo, g_value_get_boolean (value));
       break;
     case PROP_ENABLE_ARROWS_ALWAYS:
-      /* This call does the notification */
       gtk_combo_set_use_arrows_always (combo, g_value_get_boolean (value));
       break;
     case PROP_CASE_SENSITIVE:
-      /* This call does the notification */
       gtk_combo_set_case_sensitive (combo, g_value_get_boolean (value));
       break;
+    case PROP_ALLOW_EMPTY:
+      combo->ok_if_empty = g_value_get_boolean (value);
+      break;
+    case PROP_VALUE_IN_LIST:
+      combo->value_in_list = g_value_get_boolean (value);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -1058,6 +1083,12 @@ gtk_combo_get_property (GObject         *object,
     case PROP_CASE_SENSITIVE:
       g_value_set_boolean (value, combo->case_sensitive);
       break;
+    case PROP_ALLOW_EMPTY:
+      g_value_set_boolean (value, combo->ok_if_empty);
+      break;
+    case PROP_VALUE_IN_LIST:
+      g_value_set_boolean (value, combo->value_in_list);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;